1. Field of the Invention
The invention relates to image processing technology in video or image-related equipment, and more particularly, to a method and apparatus for reducing the number of gradations, i.e., color shades or gray-scale, of an image input by, for example, a CCD camera, while reducing the effects of shading, i.e., differences in brightness caused by uneven lighting.
2. Description of Related Art
Recently, compact portable information processing equipment has been developed such that not only hand-written input information, but also images, can be input by installing, for example, a CCD camera. Such compact portable information processing equipment is typically provided with a display unit for both displaying the input information simultaneously with inputting the information, and for reading and displaying information already input. In consideration of battery life, a reflective liquid crystal display device, i.e., LCD, is commonly used as the display unit for this type of compact portable equipment.
This LCD in general has a small number of display gradations. For example, four gradations are frequently used. In contrast to this, a CCD camera using a CCD photography device has 256 gradations, which is a large number of gradations. Accordingly, when the image input by the CCD camera is displayed on the LCD, the number of gradations must be reduced using a gradation process, i.e., a halftoning process or an indexing process, for example.
A process for reducing the number of gradations is the "Ohtsu method" (see the Denki Tsushin Gakkai Ronbun Magazine, '84/4, vol. J63-D, No. 4, pg. 349). Other methods include an error diffusion method and a dither method.
The aforementioned "Ohtsu method" provides technology suitable for setting the threshold values used in binary conversion, but when this is used without modification, for example to obtain four gradations, three times the processing volume is required as in binary conversion. In other words, in converting to four values, it is necessary to determine three threshold values. Consequently, it is necessary to first accomplish the process for determining the threshold value used in binary conversion and then to determine in a similar manner the threshold values of each of the respective regions partitioned by this first threshold value. Consequently, the process of binary conversion must be performed three times. Hence the volume of computations becomes enormous and a problem arises that a long processing time is required.
On the other hand, the error diffusion method and the dither method are methods that output gradations two-dimensionally, i.e., halftoning, for example. Consequently, these methods have the defect that it is difficult to preserve edges of images. Hence, when an image such as a line drawing with characters or diagrams in the midst of a bright background is input and the gradation conversion process is performed, edge portions of the line drawing which are meaningful information thereof easily become unclear. Consequently, the problem arises that an image which looks good cannot be obtained. Accordingly, when inputting images, particularly for line drawings such as characters or diagrams, a binary conversion process using a fixed threshold value through, for example, the Ohtsu method is suitable.
However, for images having shading which are photographed by an area sensor such as, for example, a CCD camera, when a process is accomplished for reducing the number of gradations using a fixed threshold value in order to preserve the edges, a problem arises with respect to the background area. The background area that is darkened due to the effects of shading becomes smeared black and appears with contour lines in accordance with the threshold value. This area which is darkened because of the effects of shading is primarily the background area near the edges of the image. However, when small characters exist in this area, a problem arises that it becomes impossible to distinguish the characters. This results in an image which is not pleasing to the eye.